﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ProductSearch.ascx.cs"
    EnableViewState="false" Inherits="TimKen.Web.UserControls.ProductSearch" %>
<link rel="stylesheet" type="text/css" href="../Common/Style/style.css" />
<script language="javascript" type="text/javascript">
    //产品搜索
    function searchproduct() {
        var productNo = document.getElementById('ProductNO').value;
        var desc = document.getElementById('ProductDesc').value;
        var brandid = $("#hid_uiliPropValue").val();//  document.getElementById("brand").value;
        if (productNo == "" && desc == "") {
            window.location.href = '/Category.aspx?BrandID=' + brandid;
        } else {
            window.location.href = '/Product.aspx?type=1&BrandID='
         + brandid + '&Desc='
         + encodeURI(desc)
         + '&KeyWords=' + encodeURI(productNo);
        }
        return false;
    }
    function srchSubmit() {
        var pno = '<%=KeyWords%>';
        var bid = '<%=BrandID%>';
        var dsc = '<%=Desc%>';
        if (pno != '')
            document.getElementById('ProductNO').value = pno;
        if (dsc != '')
            document.getElementById('ProductDesc').value = dsc;

    }

    function onkeySearch() {
        if (window.event.keyCode == 13) {
            searchproduct();
        }
    }
    function uilionclcik(textValue) {
        $("#hid_uiliPropValue").val(textValue); 
    }
    
</script>
<table border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>
            <%=GetLangString("ItemCode")%>：
            <input type="text" id="ProductNO" name="ProductNO" class="common_searchin" style="width: 100px;" onkeydown="onkeySearch();">
        </td>
        <td>
            <%--<select id="brand" onkeydown="onkeySearch();">
                <option value="0">
                    <%=GetLangString("ChooseBrand") %></option>
                <%foreach (System.Data.DataRow dr in drcBrand)
                  { %>
                <option value="<%=dr["BrandID"]%>" <%=BrandID==dr["BrandID"].ToString()?"selected=selected":""%>>
                    <%=dr["Name"]%></option>
                <%} %>
            </select>--%>
            <input type="hidden" id="hid_uiliPropValue" />
            <div class="common_search_tkSearch">
                <ul class="common_search_tk_txt">
                    <%=GetLangString("ChooseBrand") %></ul>
                <ul class="common_search_tkicon">
                </ul>
                <ul class="common_search_tkbox">
                    <%foreach (System.Data.DataRow dr in drcBrand)
                      { %><li onclick='uilionclcik(<%=dr["BrandID"]%>)'>
                      <%=dr["Name"]%></li>
                    <%} %>
                </ul>
            </div>
        </td>
        <td>
            <%=GetLangString("DetailDescription")%>：
            <input type="text" id="ProductDesc" class="common_searchint" name="ProductDesc" style="width: 100px;" onkeydown="onkeySearch();">
        </td>
        <td>
            <% if (LanguageID == 1)
               {%>
            <a href="#">
                <img src="../image/search_btn.gif" id="imgNewsSearch" onkeydown="onkeySearch();"
                    onclick="searchproduct(); return false;" /></a>
            <%}
               else
               {%>
            <a href="#">
                <img src="../Common/Image/iconbtnbg_en/search_btn.gif" id="Image1" onclick="searchproduct(); return false;" /></a>
            <%} %>
        </td>
    </tr>
</table>
